<!DOCTYPE html>
<html>
<head>
    <title>小程序配置</title>
		<#include "/header.html">	
		<script src="${request.contextPath}/statics/libs/ajaxupload.js"></script>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
			<#if shiro.hasPermission("dev:config:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("dev:config:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("dev:config:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
        	<div class="form-group">
				<div class="col-sm-2 control-label">全局配置</div>
				<label class="radio-inline">
					<input type="radio" name="type" v-model="type" value="1"/> 小程序配置
				</label>
				<label class="radio-inline" v-show="config.uid == 1">
					<input type="radio" name="type" v-model="type" value="2"/> 短信验证配置
				</label>
				<label class="radio-inline" >
					<input type="radio" name="type" v-model="type" value="3"/> 佣金配置
				</label>
				<label class="radio-inline" >
					<input type="radio" name="type" v-model="type" value="4"/> 提现配置
				</label>
			</div>
        	
			
			<div v-show="type == 1">
			
        	<div class="form-group">
				<div class="col-sm-2 control-label">小程序名称</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="config.name" placeholder="小程序名称"/>
				</div>
			</div>
        	
        	<div class="form-group">
				<div class="col-sm-2 control-label">App ID</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="config.appId" placeholder="小程序唯一标识 (在微信小程序管理后台获取)"/>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-2 control-label">App Secret</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="config.appSecret" placeholder="小程序的 app secret (在微信小程序管理后台获取)"/>
				</div>
			</div>
        	<div class="form-group">
				<div class="col-sm-2 control-label">MchId</div>
				<div class="col-sm-10">
				  <input type="text" class="form-control" v-model="config.mchId" placeholder="商户号"/>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-2 control-label">ApiKey</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="config.apiKey" placeholder="API密钥"/>
				</div>
			</div>
			
        	
			<div class="form-group">
                <div class="col-sm-2 control-label">商户证书</div>
                <div class="col-sm-10">
					<button type="button" class="layui-btn" id="upload"><i class="layui-icon"></i>上传商户证书</button>
                	<span class="layui-inline layui-upload-choose">{{config.certName}}</span>
                </div>
            </div>
            
            <div class="form-group">
                 <div class="col-sm-2 control-label">小程序背景图</div>
                 <div class="col-sm-10">
                   <!--   <input type="text" class="form-control" v-model="hotel.pic" placeholder="封面图"/> -->
                     <button type="button" class="layui-btn" id="uploadbg"><i class="layui-icon"></i>上传背景图</button>
         			<span class="layui-inline layui-upload-choose">
         				尺寸:550*412
         			</span>
         			<span class="layui-inline layui-upload-choose" style="padding: 10px 0px;">
         				<img class="layui-upload-img" :src="'${request.contextPath}/userfiles/config/'+config.bg"  style="height: 200px;width: 100%;">
         			</span>
                 </div>
             </div>	
          	
          	<div class="form-group">
				<div class="col-sm-2 control-label">模版ID</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="config.giveTemplateId" placeholder="赠送早餐券所需下发的模板消息的id"/>
				</div>
			</div>
			
			
           
							            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定" style="margin-left:20px;width:200px;"/>
         
            </div>
            
            </div>
            
            <div v-show="type == 2">
	        	<div class="form-group">
					<div class="col-sm-2 control-label">Access Key ID</div>
					<div class="col-sm-10">
						<input type="text" class="form-control" v-model="config.accessKeyId" placeholder="短信验证所需的access key id(在阿里云管理后台获取)"/>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">Access Key Secret</div>
					<div class="col-sm-10">
						<input type="text" class="form-control" v-model="config.accessKeySecret" placeholder="阿里云的 app secret (在在阿里云管理后台获取)"/>
					</div>
				</div>
				
	        	
	           
				<div class="form-group">
	                <div class="col-sm-2 control-label"></div>
	                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定" style="margin-left:20px;width:200px;"/>
	         
	            </div>
          </div>
          
          <div v-show="type == 3">
	        	<div class="form-group">
					<div class="col-sm-2 control-label">客房分销</div>
					<label class="radio-inline">
						<input type="radio" name="recommendCode" v-model="config.recommendCode" value="1"/> 开启
					</label>
					<label class="radio-inline">
						<input type="radio" name="recommendCode" v-model="config.recommendCode" value="0"/> 关闭
					</label>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">推广佣金(元)</div>
					<div class="col-sm-10">
						<input type="text" class="form-control" v-model="config.recommendMoney" placeholder="佣金"/>
					</div>
				</div>
				<div class="form-group">
	                <div class="col-sm-2 control-label">推广规则</div>
	                <div class="col-sm-10">
	                     <textarea placeholder="推广规则" class="layui-textarea" v-model="config.recommendTip"></textarea>
	                </div>
	            </div>
	        	
	        	<div class="form-group">
	                 <div class="col-sm-2 control-label">推广海报</div>
	                 <div class="col-sm-10">
	                   <!--   <input type="text" class="form-control" v-model="hotel.pic" placeholder="封面图"/> -->
	                     <button type="button" class="layui-btn" id="uploadbg2"><i class="layui-icon"></i>上传背景图</button>
	         			<span class="layui-inline layui-upload-choose">
	         				尺寸:550*412
	         			</span>
	         			<span class="layui-inline layui-upload-choose" style="padding: 10px 0px;">
	         				<img class="layui-upload-img" :src="'${request.contextPath}/userfiles/config/'+config.recommendPic"  style="height: auto;width: 100%;">
	         			</span>
	                 </div>
	            </div>	
	            <div class="form-group">
					<div class="col-sm-2 control-label">二维码X轴</div>
					<div class="col-sm-10">
						<input type="number" class="form-control" v-model="config.qrcodex" placeholder="二维码X轴"/>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">二维码Y轴</div>
					<div class="col-sm-10">
						<input type="number" class="form-control" v-model="config.qrcodey" placeholder="二维码Y轴"/>
					</div>
				</div>
	           
				<div class="form-group">
	                <div class="col-sm-2 control-label"></div>
	                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定" style="margin-left:20px;width:200px;"/>
	         
	            </div>
          </div>
          
          
          <div v-show="type == 4">
          		<div class="form-group">
					<div class="col-sm-2 control-label">最少提现金额(元)</div>
					<div class="col-sm-10">
						<input type="text" class="form-control" v-model="config.withdrawalMinMoney" placeholder="佣金"/>
					</div>
				</div>
				<div class="form-group">
	                <div class="col-sm-2 control-label">提现规则</div>
	                <div class="col-sm-10">
	                     <textarea placeholder="提现规则 " class="layui-textarea" v-model="config.withdrawalTip"></textarea>
	                </div>
	            </div>
				
	        	
	           
				<div class="form-group">
	                <div class="col-sm-2 control-label"></div>
	                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定" style="margin-left:20px;width:200px;"/>
	         
	            </div>
          </div>
					
        </form>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/dev/config.js?_${.now?long}"></script>
</body>
</html>